<?php


namespace src\controller;

/**
 *  简单工厂 工厂调用类
 * Class Factory
 * @package controller
 */
class Factory
{
    /**
     * @param $operate
     * @return WeChatPay|string
     */
    public static function pay($operate)
    {
        switch ($operate){
            case "WeChatPay":
                $result = new WeChatPay();
                break;
            case "AliPay":
                $result = new AliPay();
                break;
            default:
                $result = "wechat ";
                break;
        }
        return $result;
    }
}